#include "widget.h"
#include <QTreeWidget>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
{
    QTreeWidget treeWidget;
    treeWidget.setColumnCount(1);
    QTreeWidgetItem *root = new QTreeWidgetItem(&treeWidget,
                                                QStringList(QString("Root")));
    new QTreeWidgetItem(root,QStringList(QString("Leaf 1")));
    QTreeWidgetItem *leaf2 = new QTreeWidgetItem(root,QStringList(QString("Leaf 2")));
    leaf2->setCheckState(0,Qt::Checked);
    QList<QTreeWidgetItem *> rootList;
    rootList<<root;
    treeWidget.insertTopLevelItems(0,rootList);
    treeWidget.show();
}

Widget::~Widget()
{

}
